﻿using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;

namespace Project1
{
    class Latin
    {
        public Latin()
        {

        }

        public void convertEnglishtoPigLatin(string sentence)
        {
            foreach (string word in sentence.Split())
            {
                string firstLetter = word.Substring(0, 1);
                string restOfTheWord = word.Substring(1, word.Length - 1);

                if (isVowel(firstLetter))
                {
                    Console.Write(restOfTheWord + firstLetter + "ay ");
                }
                else
                {
                    Console.Write(firstLetter + restOfTheWord + "way ");
                }
            }
        }
        public bool isVowel(string firstLetter)
        {
            List<string> vowels = new List<string>();
            vowels.Add("a");
            vowels.Add("e");
            vowels.Add("i");
            vowels.Add("o");
            vowels.Add("u");

            if (vowels.Contains(firstLetter))
            {
                return false;
            }
            else
                return true;
        }
    }
}
